<!DOCTYPE html>
<html lang="en">
<head>
    <link th:replace="include/header.html">
    <title th:text="${title}"></title>
    <style type="text/css">
        .select{background: red;}
        .selectStock{background: burlywood;}
    </style>
</head>
<body>
    <h1 th:text="${title}" align="center"></h1>
    <table width="90%" class="table">
        <tr>
            <th>排序</th>
            <th>代码</th>
            <th>名称</th>
            <th>仓位建议</th>
            <th>持仓-占比-跌幅</th>
            <th>平均跌幅</th>
        </tr>
        <tr th:each="f : ${funds}">
            <td th:text="${f.index}"></td>
            <td th:text="${f.code}"></td>
            <td th:text="${f.name}"></td>
            <td  >
                <span th:each=" s,status: ${suggestionTypes}">
                    <span th:text="${s.desc}"
                          th:class="${f.suggestionType.value == s.value} ? 'select' : ''">
                    </span>
                    <span th:text="${!status.last}?'->':''"></span>
                </span>
            </td>
            <td >
                <div th:each="s,status : ${f.list}" >
                    <span th:text="${s.name} + '-'" th:class="${s.id==stockId} ? 'selectStock':''"></span>
                    <span th:text="${s.percent} + '%-'"></span>
                    <span th:text="${#numbers.formatDecimal((1 - s.nowPrice/s.maxPrice) * 100, 1, 2)} + '%'"></span>
                </div>
            </td>
            <td th:text="${#numbers.formatDecimal(f.avgLoss * 100, 1, 2)} + '%'"></td>
        </tr>
    </table>
</body>
</html>